<template>
  <div>
    <van-nav-bar
      :z-index="999"
      :fixed="true"
      left-arrow
      @click-left="onClickLeft"
      :placeholder="true"
      title="考点视频"
    ></van-nav-bar>

    <div class="esoterica_background">
      <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
        <div
          class="esoterica"
          v-for="(item, index) in lists"
          :key="index"
          @click="href('/TeachingVideo', item.id)"
        >
          <img :src="item.picaddress" alt />
          <div class="esoterica-list">
            <p>{{ item.title }}</p>
            <!-- <div class="esoterica_cntent">{{ item.content }}</div> -->
            <div class="esoterica-item">
              <!-- <div>
                <img src="../../assets/images/16.png" alt />
                <p>{{item.collect}}</p>
              </div> -->
              <div>
                <img src="../../assets/images/64.png" alt />
                <p>{{ item.djl }}</p>
              </div>
            </div>
          </div>
        </div>
      </van-pull-refresh>
    </div>
  </div>
</template>

<script>
import { ExamVideo } from "../../assets/js/api/exam";
export default {
  name: "TestVideo",
  data() {
    return {
      isLoading: false,
      // 假数据
      lists: []
    };
  },

  created() {
    let dsBridge = require("dsbridge");
    dsBridge.call("goBack", "", function() {
      history.go(-1);
    });
    this.Video();
  },

  methods: {
    Video() {
      ExamVideo(this.$route.params.type, "1").then(res => {
        if (res.code == 0) {
          this.lists = res.data;
          // console.log(this.lists);
        }
      });
    },

    onClickLeft() {
      this.$router.go(-1);
    },
    href(url, id) {
      this.$router.push({
        path: url + "/" + this.$route.params.type + "/" + id
      });
    },
    onRefresh() {
      setTimeout(() => {
        // console.log("刷新成功");
        this.isLoading = false;
      }, 1000);
    }
  }
};
</script>

<style></style>
